<%@ taglib prefix="c" uri="jakarta.tags.core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <base href="<%=request.getContextPath()%>/">
    <meta charset="UTF-8">
    <title>支付确认 - 医疗预约系统</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <style>
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background-color: #f5f5f5;
            margin: 0;
            padding: 20px;
        }
        .container {
            max-width: 600px;
            margin: 0 auto;
            background-color: white;
            padding: 30px;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        h1 {
            color: #333;
            margin-bottom: 25px;
            padding-bottom: 10px;
            border-bottom: 1px solid #eee;
        }
        .form-group {
            margin-bottom: 20px;
        }
        label {
            display: block;
            margin-bottom: 8px;
            font-weight: 500;
            color: #555;
        }
        .form-control {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            box-sizing: border-box;
            font-size: 14px;
        }
        select.form-control {
            height: 38px;
        }
        .form-actions {
            margin-top: 30px;
        }
        .btn {
            padding: 10px 20px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
            text-decoration: none;
            display: inline-block;
            text-align: center;
        }
        .btn-primary {
            background-color: #007bff;
            color: white;
        }
        .btn-default {
            background-color: #6c757d;
            color: white;
            margin-left: 10px;
        }
        .error-message {
            color: #dc3545;
            margin-bottom: 15px;
            padding: 10px;
            background-color: #f8d7da;
            border-radius: 4px;
            border: 1px solid #f5c6cb;
        }
        .success-message {
            color: #28a745;
            margin-bottom: 15px;
            padding: 10px;
            background-color: #d4edda;
            border-radius: 4px;
            border: 1px solid #c3e6cb;
        }
        .info-section {
            background-color: #f8f9fa;
            padding: 15px;
            border-radius: 4px;
            margin-bottom: 20px;
        }
        .info-item {
            margin-bottom: 10px;
        }
        .info-item strong {
            display: inline-block;
            width: 100px;
        }
    </style>
</head>
<body>
<div class="container">
    <h1>支付确认</h1>
    
    <!-- 消息提示 -->
    <c:if test="${not empty error}">
        <div class="error-message">
            ${error}
        </div>
    </c:if>
    
    <c:if test="${not empty success}">
        <div class="success-message">
            ${success}
        </div>
    </c:if>
    
    <!-- 支付信息 -->
    <c:if test="${not empty pay}">
        <div class="info-section">
            <div class="info-item">
                <strong>订单号：</strong>${pay.orderNo}
            </div>
            <div class="info-item">
                <strong>患者姓名：</strong>${pay.appointment.patientName}
            </div>
            <div class="info-item">
                <strong>预约科室：</strong>${pay.appointment.visit.department.deptName}
            </div>
            <div class="info-item">
                <strong>预约时间：</strong>${pay.appointment.visit.visitDate}
            </div>
            <div class="info-item">
                <strong>支付金额：</strong><span style="color: #e74c3c; font-size: 18px;">¥${pay.amount}</span>
            </div>
        </div>
        
        <!-- 支付表单 -->
        <form action="pay/payRecord" method="post">
            <input type="hidden" name="payId" value="${pay.payId}"/>
            
            <div class="form-group">
                <label for="payMethod">支付方式：</label>
                <select id="payMethod" name="payMethod" class="form-control" required>
                    <option value="微信支付">微信支付</option>
                    <option value="支付宝">支付宝</option>
                    <option value="银行卡">银行卡</option>
                    <option value="现金">现金</option>
                </select>
            </div>
            
            <div class="form-actions">
                <button type="submit" class="btn btn-primary">
                    <i class="fas fa-credit-card"></i> 确认支付
                </button>
                <a href="pay/find" class="btn btn-default">
                    <i class="fas fa-times"></i> 取消
                </a>
            </div>
        </form>
    </c:if>
</div>
</body>
</html>